package com.csw.android.ffmpegtest.ui.base

import android.os.Bundle
import android.view.View
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.csw.android.dev_utils.ui.BaseFragment

abstract class DataBindingFragment<T : ViewDataBinding> : BaseFragment() {
    protected var dataBinding: T? = null
        private set

    override fun initView(rootView: View, savedInstanceState: Bundle?) {
        super.initView(rootView, savedInstanceState)
        dataBinding = DataBindingUtil.bind(rootView)
        dataBinding?.lifecycleOwner = this
    }

    override fun onDestroyView() {
        dataBinding = null
        super.onDestroyView()
    }
}